package com.epoint.mobileoa.tools;

import java.io.IOException;

import android.content.Context;
import android.content.res.AssetFileDescriptor;
import android.media.MediaPlayer;

/**
 * @author liyc
 * @time 2012-2-29 上午9:10:53
 * @annotation 
 */
public class AudioHelp {
	
	/**
	 * 播放音乐
	 */
	public static void playMusic(Context con,String filename) throws IOException{
		MediaPlayer m = new MediaPlayer();
		AssetFileDescriptor descriptor = con.getAssets().openFd(
				filename);
		m.setDataSource(descriptor.getFileDescriptor(),
				descriptor.getStartOffset(), descriptor.getLength());
		descriptor.close();
		m.prepare();
		m.start();
	}
}
